<?php

if (GetTariff($GL, $_SESSION['LOGIN_UID']) != "0") {
    $SCRIPTS = "
<script type=\"text/javascript\" src=\"/js/swfupload.js\"></script>
<script type=\"text/javascript\" src=\"/js/swfupload.queue.js\"></script>
<script type=\"text/javascript\" src=\"/js/fileprogress.js\"></script>
<script type=\"text/javascript\" src=\"/js/handlers.js\"></script>
<script type=\"text/javascript\">
    var upload1, upload2;
    window.onload = function() {
        upload1 = new SWFUpload({
            upload_url: \"/sys/user/upload.php?a=" . base64_encode($_SESSION['LOGIN_NAME'])."&b=" . base64_encode($_SESSION['LOGIN_PASS']) . "&c=" . base64_encode($GL["serv_server"]) . "&d=" . base64_encode("/music") . "\",
            post_params: {\"PHPSESSID\" : \"".session_id()."\"},
            file_size_limit : \"".$file_max_size."\",  
            file_types : \"".$file_exts."\",
            file_types_description : \"All Files\",
            file_upload_limit : \"".$file_total."\",
            file_queue_limit : \"0\",
    
            file_dialog_start_handler : fileDialogStart,
            file_queued_handler : fileQueued,
            file_queue_error_handler : fileQueueError,
            file_dialog_complete_handler : fileDialogComplete,
            upload_start_handler : uploadStart,
            upload_progress_handler : uploadProgress,
            upload_error_handler : uploadError,
            upload_success_handler : uploadSuccess,
            upload_complete_handler : uploadComplete,
    
            button_image_url : \"/images/uploadbutton.png\",
            button_placeholder_id : \"spanButtonPlaceHolder1\",
            button_width: 61,
            button_height: 22,
    
            flash_url : \"/swf/swfupload.swf\",
            custom_settings : {
                progressTarget : \"fsUploadProgress1\",
                cancelButtonId : \"btnCancel1\"
            },
            debug: false
        });
        upload2 = new SWFUpload({
            upload_url: \"/sys/user/upload.php?a=" . base64_encode($_SESSION['LOGIN_NAME'])."&b=" . base64_encode($_SESSION['LOGIN_PASS']) . "&c=" . base64_encode($GL["serv_server"]) . "&d=" . base64_encode("/jingls") . "\",
            post_params: {\"PHPSESSID\" : \"".session_id()."\"},
            file_size_limit : \"".$file_max_size."\",  
            file_types : \"".$file_exts."\",
            file_types_description : \"All Files\",
            file_upload_limit : \"".$file_total."\",
            file_queue_limit : \"0\",
    
            file_dialog_start_handler : fileDialogStart,
            file_queued_handler : fileQueued,
            file_queue_error_handler : fileQueueError,
            file_dialog_complete_handler : fileDialogComplete,
            upload_start_handler : uploadStart,
            upload_progress_handler : uploadProgress,
            upload_error_handler : uploadError,
            upload_success_handler : uploadSuccess,
            upload_complete_handler : uploadComplete,
    
            button_image_url : \"/images/uploadbutton.png\",
            button_placeholder_id : \"spanButtonPlaceHolder2\",
            button_width: 61,
            button_height: 22,
    
            flash_url : \"/swf/swfupload.swf\",
            custom_settings : {
                progressTarget : \"fsUploadProgress2\",
                cancelButtonId : \"btnCancel2\"
            },
            debug: false
        });
    }
</script>";

$t_BODY = "
<form id=\"form\" action=\"/?action=ftp\" method=\"post\" enctype=\"multipart/form-data\">
    <table class=\"upload\">
    <tr>
        <td><span class=\"title\">Загрузить в папку /music</span></td>
        <td><span class=\"title\">Загрузить в папку /jingls</span></td>
    </tr>
        <td>
            <div id=\"fsUploadProgress1\"></div>
            <span id=\"spanButtonPlaceHolder1\"></span>
            <input id=\"btnCancel1\" type=\"button\" value=\"Отменить\" onclick=\"cancelQueue(upload1);\" disabled=\"disabled\" hidden=\"hidden\" />
        </td>
        <td>
            <div class=\"uploads\" id=\"fsUploadProgress2\"></div>
            <span id=\"spanButtonPlaceHolder2\"></span>
            <input id=\"btnCancel2\" type=\"button\" value=\"Отменить\" onclick=\"cancelQueue(upload2);\" disabled=\"disabled\" hidden=\"hidden\" />
        </td>
    </tr>
    </table>
</form>
<br />
<p>Примечание: Для корректного отображения кириллицы в плейлисте очистите id3v2 тэги загружаемых mp3-файлов.</p>";
}
else
    $t_BODY = "<p>В Ваш тариф не входит доступ к ftp.</p>";

$t_title = "Загрузить музыку";
$HEADER .=" - ".$t_title;

?>

